home *** CD-ROM | disk | FTP | other *** search
/ NetNews Offline 2 / NetNews Offline Volume 2.iso / news / comp / lang / c-part1 / 1523 < prev    next >
Encoding:
Text File  |  1996-08-05  |  548 b   |  29 lines

  1. Path: news.abo.fi!toffe
  2. From: csundqvi@abo.fi (Christoffer Sundqvist)
  3. Newsgroups: comp.lang.c
  4. Subject: How to access memory allocated  in function
  5. Date: Mon, 15 Jan 96 13:46:17 GMT
  6. Organization: Department of Business Administration
  7. Message-ID: <4ddbe3$so3@josie.abo.fi>
  8. NNTP-Posting-Host: toffe.abo.fi
  9. X-Newsreader: News Xpress Version 1.0 Beta #4
  10.  
  11. Hello
  12.  
  13.  
  14. How can i access memory allocated dynamically in a function after i leave the 
  15. function, something like this:
  16.  
  17. main()
  18. {
  19. int *p;
  20. sub(p);
  21. }
  22.  
  23. void sub(int *p)
  24. {
  25.  p = malloc(.....);
  26. }
  27.  
  28. Thanks !
  29.